/*
 *   (c) Copyright 2006-2008
 *   FILENAME     :  BaseEntity.java
 *   PACKAGE      :  com.sankyu.dlmp.framework.entity
 *   CREATE DATE  :  Mar 3, 2008
 *   AUTHOR       :  Chen Wu
 */
package com.twl.common.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 基本Entity类，包含了create_by，update_by，create_date，update_date，active_flag 五个基本的字段，
 * 其它Entity类可以从此继承扩展
 */
@MappedSuperclass
public abstract class CrudEntity extends IdEntity
{
	
    /** 创建者 */
    private Long createBy;

    /** 更新者 */
    private Long updateBy;

    /** 创建日期 */
    private Date createDate;

    /** 更新日期 */
    private Date updateDate;

    /**
     * @return Returns the createBy.
     */
    @Column(name = "create_by", updatable = false)
    public Long getCreateBy()
    {
        return createBy;
    }

    /**
     * @param createBy The createBy to set.
     */
    public void setCreateBy(Long createBy)
    {
        this.createBy = createBy;
    }

    /**
     * @return Returns the createDate.
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_date", updatable = false)
    public Date getCreateDate()
    {
        return createDate;
    }

    /**
     * @param createDate The createDate to set.
     */
    public void setCreateDate(Date createDate)
    {
        this.createDate = createDate;
    }

    /**
     * @return Returns the updateBy.
     */
    @Column(name = "update_by")
    public Long getUpdateBy()
    {
        return updateBy;
    }

    /**
     * @param updateBy The updateBy to set.
     */
    public void setUpdateBy(Long updateBy)
    {
        this.updateBy = updateBy;
    }

    /**
     * @return Returns the updateDate.
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_date")
    public Date getUpdateDate()
    {
        return updateDate;
    }

    /**
     * @param updateDate The updateDate to set.
     */
    public void setUpdateDate(Date updateDate)
    {
        this.updateDate = updateDate;
    }
}
